﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Menu.Master" AutoEventWireup="true" CodeBehind="ConsumosXEstilo.aspx.cs" Inherits="Emporium_Web.ConsumosXEstilo" Theme="Constellation" %>

<%@ MasterType VirtualPath="~/Menu.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register src="Search/ComponenteAdd.ascx" tagname="ComponenteAdd" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="js/funciones.grid.js"></script>
    <script type="text/javascript">
        function Check(itemId) {
            Regs = document.getElementById('<%= this.hdnSeleccion.ClientID %>');
            Regs.value = itemId;
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!-- Content -->
    <article class="container_12">
	  
		<section class="grid_12">
			<div class="block-border">
			<form runat="server" class="block-content form" id="table_form">
				<h1>Consumos por Estilo</h1>
                 <ajaxtoolkit:toolkitscriptmanager ID="toolk" runat="server"></ajaxtoolkit:toolkitscriptmanager>
                
                <asp:UpdatePanel ID = "upContent" runat="server">
                <ContentTemplate>   
                <div>
                              
                <div style="width: 100%; float: left; padding-top: 20px;">
                    <div style="width: 100%; float: left;">
                        <div style="width: 100%; height: 45px; float: left;">
                            <div style="width: 100px; float: left;">
                                <label>
                                    Estilo</label>
                            </div>
                            <div align="left" style="width: 70%; float: left;">
                                <asp:TextBox ID="txtEstilo" name="simple-required" Enabled="false" runat="server" Width="75%"></asp:TextBox>
                            </div>
                        </div>
                    </div>
                </div>

				<div style="width:100%; float:left; padding-top:11px; padding-bottom:20px;">
                    <asp:HiddenField ID="hdnSeleccion" runat="server" />
                    <asp:HiddenField ID="hdnSeleccionCmp" runat="server" />
					<ul class="message error no-margin" runat="server" id="errorMessage">
					    <li><asp:Label runat="server" ID="lblErrorMessage"></asp:Label></li>
					</ul>
                    <ul class="message warning no-margin" runat="server"  id="warningMessage">
					    <li><asp:Label runat="server" ID="lblWarningMessage"></asp:Label></li>
					</ul>
                    <br />

                    <div style="width:50%; float:left;" align="left">
                    <label>Variantes</label>
                    <asp:GridView ID="gvVariantes" runat="server" SkinID="gridviewSkin" PageSize="10" Width="100%"
                            AutoGenerateColumns="False" ShowFooter="false" DataKeyNames = "Variante_Id"      
                            onrowdatabound="gvVariantes_RowDataBound" 
                            onselectedindexchanged="gvVariantes_SelectedIndexChanged">
						<Columns>
                            <asp:CommandField ButtonType="Image" SelectImageUrl="~/images/unselected.png" ShowSelectButton="True" >
                                <HeaderStyle/>
                            </asp:CommandField>
                            <asp:TemplateField HeaderText="Sec."  HeaderStyle-HorizontalAlign="Left">                                 
                                <ItemTemplate> 
                                    <asp:Label ID="lblSecuencia" runat="server" Text='<%# Bind("Variante_Secuencia","{0:000}") %>'></asp:Label> 
                                </ItemTemplate> 
                                <ItemStyle Width="5%" />
                            </asp:TemplateField> 
                            <asp:TemplateField HeaderText="Descripcion" HeaderStyle-HorizontalAlign="Left">                                 
                                <ItemTemplate> 
                                    <asp:Label ID="lblDescripcion" runat="server" Text='<%# Bind("Variante_Descripcion") %>'></asp:Label> 
                                </ItemTemplate> 
                                <ItemStyle Width="50%" />
                            </asp:TemplateField>						

                             <asp:TemplateField HeaderText="Estado"  HeaderStyle-HorizontalAlign="Left">                                 
                                <ItemTemplate>
                                    <asp:Label ID="lblEstado" runat="server" Text='<%# Eval("Variante_Estado") %>' ></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>
                            						
                             <asp:TemplateField HeaderText="F.Registro"  HeaderStyle-HorizontalAlign="Left">                                
                                <ItemTemplate> 
                                    <asp:Label ID="lblFechaRegistro" runat="server" Text='<%# Bind("Variante_FechaRegistro","{0:dd/MM/yyyy}") %>'></asp:Label> 
                                </ItemTemplate> 
                            </asp:TemplateField> 
                                                 
						</Columns>  
						<PagerSettings Visible="false" />
					</asp:GridView> 
                                        
                    </div>					

                    <div style="width:45%; float:left; padding-left:5%;" align="left">
                    <label>Componentes</label>
                    <asp:GridView ID="gvComponentes" runat="server" SkinID="gridviewSkin"  DataKeyNames="Componente_Id"
                    PageSize="10" Width="100%"  ShowFooter="False" AutoGenerateColumns="false" 
                            onselectedindexchanged="gvComponentes_SelectedIndexChanged">
						<Columns>
                            <asp:CommandField ButtonType="Image" SelectImageUrl="~/images/unselected.png" ShowSelectButton="True" >
                                <HeaderStyle/>
                            </asp:CommandField>

                             <asp:TemplateField HeaderText="Código"  HeaderStyle-HorizontalAlign="Left">
                               <ItemStyle Width="5%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblComponenteId" runat="server" Text='<%# Eval("Componente_Id","{0:00000}") %>' ></asp:Label>                                      
                                </ItemTemplate>                 
                            </asp:TemplateField>

							<asp:BoundField DataField="Componente_Descripcion" HeaderText="Descripci&oacute;n" >  
                                <ItemStyle Width="90%" />
                            </asp:BoundField>  
						</Columns>  
						<PagerSettings Visible="false" />
					</asp:GridView> 
                    

                    <div align="left" style="width:90%; float:inherit; vertical-align:middle; padding-top:15px;">
					        <asp:LinkButton ID="btnComponentesAdicionar" runat="server" Text="Adicionar" 
                                CssClass="button" onclick="btnComponentesAdicionar_Click" />
				            <asp:LinkButton ID="btnComponentesEliminar" runat="server" Text="Eliminar" 
                                CssClass="button" onclick="btnComponentesEliminar_Click" />
					        <asp:LinkButton ID="btnComponentesGrabar" runat="server" Text="Grabar" 
                                CssClass="button" onclick="btnComponentesGrabar_Click" />
				            <uc1:ComponenteAdd ID="componenteAdd" runat="server" />
				        </div>
                    </div>
				</div>

                <div style="width:100%; float:left; padding-top:11px; padding-bottom:20px;">
                    <div style="width:100%; float:left;" align="left">
                    <label>Items</label>
                    <asp:GridView ID="gvItems" runat="server" SkinID="gridviewSkin" PageSize="10" DataKeyNames="VarIte_Id"
                            Width="100%" AutoGenerateColumns="False" ShowFooter="false" 
                            onrowdatabound="gvItems_RowDataBound">
						<Columns>
                            <asp:TemplateField>
								<HeaderTemplate>
								</HeaderTemplate>
								<ItemTemplate>
                                       <input id="rbSelect" type="radio" name="selectGroup" value="rbSelect" onclick="javascript:Check('<%# Eval("VarIte_Id") %>');"/>
								</ItemTemplate>
								<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
								<ItemStyle HorizontalAlign="Left" Width="5%" />
							</asp:TemplateField>  

                            <asp:TemplateField>
                                <HeaderStyle HorizontalAlign="Left" ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>                                
                                Var.Item
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnConsultar" runat="server" Text='<%# Eval("VarIte_Id","{0:00000}") %>' OnClick="btnConsultar_Click"  />
								</ItemTemplate>
                            </asp:TemplateField>
                                                        							
                            <asp:TemplateField HeaderText="Código"  HeaderStyle-HorizontalAlign="Left">
                               <ItemStyle Width="5%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblItemId" runat="server" Text='<%# Eval("VarIte_Id","{0:00000}") %>' ></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Item/Tela"  HeaderStyle-HorizontalAlign="Left">
                                <ItemStyle HorizontalAlign="Left" Width="30%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblItemDescripcion" runat="server"></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>
                            <asp:BoundField DataField="VarIte_ConsumoBase" HeaderText="Consumo" >
                                <ItemStyle HorizontalAlign="Left" Width="5%" />
                            </asp:BoundField>  

                            <asp:TemplateField HeaderText="U.M."  HeaderStyle-HorizontalAlign="Left">
                               <ItemStyle Width="5%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblUnidadMedida" runat="server" Text='<%# Eval("TG_UnidadMedida1.UniMed_DescripcionCorta") %>' ></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>
                           
                            <asp:BoundField DataField="VarIte_ConsumoAlterno" HeaderText="Cons.Alt." >
                                <ItemStyle HorizontalAlign="Left" Width="5%" />
                            </asp:BoundField>  
                             <asp:TemplateField HeaderText="U.M.Alt."  HeaderStyle-HorizontalAlign="Left">
                               <ItemStyle Width="5%" />
                               <ItemTemplate>
                                    <asp:Label ID="lblUnidadMedidaAlt" runat="server" Text='<%# Eval("TG_UnidadMedida.UniMed_DescripcionCorta") %>' ></asp:Label>                                      
                                </ItemTemplate> 
                            </asp:TemplateField>                                                        
                            <asp:BoundField DataField="VarIte_Observacion" HeaderText="Observación" >
                                <ItemStyle HorizontalAlign="Left" Width="40%"/>
                            </asp:BoundField>     
						</Columns>  
						<PagerSettings Visible="false" />
					</asp:GridView> 
                    </div>					
				</div>
                <!-- footer para cerrar el estilo bien-->
				<div align="left" style="width:100%; float:inherit; vertical-align:middle;">
					<asp:LinkButton ID="btnAdicionar" runat="server" Text="Adicionar" CssClass="button" onclick="btnAdicionar_Click" />
				    <asp:LinkButton ID="btnModificar" runat="server" Text="Modificar" CssClass="button" onclick="btnModificar_Click" />
					<asp:LinkButton ID="btnEliminar" runat="server" Text="Eliminar" CssClass="button" onclick="btnEliminar_Click" OnClientClick="return DeleteRegistro();"/>
                    <asp:LinkButton ID="btnColores" runat="server" Text="Colores" CssClass="button" 
                        onclick="btnColores_Click"/>
					<asp:LinkButton ID="btnAtras" runat="server" Text="Atr&aacute;s" CssClass="button" onclick="btnAtras_Click" />
				</div>
				</div> 

                </ContentTemplate>
                </asp:UpdatePanel>
			</form>
			</div>
		</section>
	</article>
</asp:Content>
